#!/bin/bash
function mknew {
fn="$1"
ofn="$2"
#$i/tui.pl
cat $fn | sed -e 's/^Test.UI.*Sett.*mand.list.*$//g' \
 -e 's/^[a-zA-Z_]* size=.*$//g' \
 -e 's/^Test.UI.*setCurrent.*$//g' | \
 sed -e "s/^.*PromptForm Setting command.*$//g" \
 -e 's/^.*m.newsIndex=.*//g' -e 's/^.*m_headerIndex=.*//g' \
 -e 's/^.*setSelectedIndex.*//g' -e 's/^.*getSelectedIndex.*//g' \
 -e 's/^.*UI.List.delete.all.*$//g' \
 -e 's/^Test UI List command,displayable,dispsame=.*$//g' \
 -e 's/^Test UI Form command,displayable,dispsame=.*$//g' \
 -e 's/^Test UI Form append int.*$//g' \
 | \
 sed -e 's/^BMForm.size=.*$//g' -e 's/^.*Override.existing.feeds.*$//g' \
 -e 's/^equals.*$//g' \
 -e 's/^Test UI Form Title: Loading$//g' \
 -e 's/^Test UI Form append: .Loading.,Loading item...$//g' | \
 sed -e 's/^\(Test.UI.*dispsame=\[\)Manage.bookmarks/\1Bookmarks/g' \
 -e 's/^\(Test.UI.*Implicit select,\)Manage bookmarks,/\1Bookmarks,/g' \
 -e 's/^\(Test.UI.*\),Manage bookmarks,/\1,Bookmarks,/g' \
 -e 's/^\(Test.UI Form append: \[Loading\],\)updating feed/\1Updating feed/g' \
 -e 's/^\(Test.UI Form append string: \)\[[^]]*\],/\1[],/g' \
 -e 's/^\(Test.UI Form append int: \)\[[^]]*\],/\1[],/g' \
 -e 's/^\(Test.UI Form append: \)\[[^]]*\],/\1[],/g' \
 -e 's/^\(Test.UI List command,displayable,dispsame=\)\[[^]]*\],/\1[],/g' \
 -e 's#Test headers.items#Test news/items#g' > $ofn
}
mknew $ii/whyx1 $ii/whyx1a
mknew $ii/whyx2 $ii/whyx2a
echo "NOTE:  Change label
NOTE:  Removed append int
NOTE:  Removed setSelectedIndex and change Test headers/items
NOTE:  Removed getSelectedIndex, and delete all
NOTE:  Removed equals output
NOTE:  Removed Title and append loading item." > $ii/whyh.diff
cp $ii/whyh.diff $ii/whyo.diff
diff -Bw $ii/whyx1a $ii/whyx2a >> $ii/whyo.diff
grep -v '^[><] *$' $ii/whyo.diff > $ii/why.diff
$i/combineTestuiLines.pl $ii/whyx1a > $ii/whyx1b
$i/combineTestuiLines.pl $ii/whyx2a > $ii/whyx2b
cp $ii/whyh.diff $ii/whym.diff
diff -B -w $ii/whyx1b $ii/whyx2b | grep -v '^[><] *$' >> $ii/whym.diff
